Global Index
HTML5 JS API Index > DOM Tutorials & Specs

Node

Extends EventTarget.

Extended by Document, DocumentFragment, DocumentType, Element, CharacterData

Node is an abstract interface and does not exist as node. It is used by all nodes (Document, DocumentFragment, DocumentType, Element, Text, ProcessingInstruction, and Comment).

Properties
const unsigned shortATTRIBUTE_NODE = 2
const unsigned shortCDATA_SECTION_NODE = 4
const unsigned short
COMMENT_NODE = 8
COMMENT_NODE (8);
const unsigned short
DOCUMENT_FRAGMENT_NODE = 11
DOCUMENT_FRAGMENT_NODE (11).
const unsigned short
DOCUMENT_NODE = 9
DOCUMENT_NODE (9);
const unsigned short
DOCUMENT_POSITION_CONTAINED_BY = 0x10
DOCUMENT_POSITION_CONTAINED_BY (16, 10 in hexadecimal);
const unsigned short
DOCUMENT_POSITION_CONTAINS = 0x08
DOCUMENT_POSITION_CONTAINS (8);
const unsigned short
DOCUMENT_POSITION_DISCONNECTED = 0x01
DOCUMENT_POSITION_DISCONNECTED (1);
const unsigned short
DOCUMENT_POSITION_FOLLOWING = 0x04
DOCUMENT_POSITION_FOLLOWING (4);
const unsigned short
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC (32, 20 in hexadecimal).
const unsigned short
DOCUMENT_POSITION_PRECEDING = 0x02
DOCUMENT_POSITION_PRECEDING (2);
const unsigned short
DOCUMENT_TYPE_NODE = 10
DOCUMENT_TYPE_NODE (10);
const unsigned short
ELEMENT_NODE = 1
ELEMENT_NODE (1);
const unsigned shortENTITY_NODE = 6
const unsigned shortENTITY_REFERENCE_NODE = 5
const unsigned shortNOTATION_NODE = 12
const unsigned short
PROCESSING_INSTRUCTION_NODE = 7
PROCESSING_INSTRUCTION_NODE (7);
const unsigned short
TEXT_NODE = 3
TEXT_NODE (3);
DOMString?
baseURI
The baseURI attribute must return the associated base URL.
NodeList
childNodes
The childNodes attribute must return a NodeList rooted at the context object matching only children.
Node?
firstChild
The firstChild attribute must return the first child.
Node?
lastChild
The lastChild attribute must return the last child.
Node?
nextSibling
The nextSibling attribute must return the next sibling.
DOMStringnodeName
unsigned shortnodeType
DOMString?nodeValue
Document?ownerDocument
Element?
parentElement
The parentElement attribute must return the parent element.
Node?
parentNode
The parentNode attribute must return the parent.
Node?
previousSibling
The previousSibling attribute must return the previous sibling.
DOMString?textContent
Operations
Node
appendChild(Node node)
The appendChild(node) method must return the result of appending node to the context object.
Node
cloneNode(optional boolean deep)
The cloneNode(deep) method must return a clone of the context object, with the clone children flag set if deep is true.
unsigned shortcompareDocumentPosition(Node other)
boolean
contains(Node? other)
The contains(other) method must return true if other is an inclusive descendant of the context object, and false otherwise (including when other is null).
boolean
hasChildNodes()
The hasChildNodes() method must return true if the context object has children, and false otherwise.
Node
insertBefore(Node node, Node? child)
The insertBefore(node, child) method must return the result of pre-inserting node into the context object before child.
booleanisDefaultNamespace(DOMString? namespace)
boolean
isEqualNode(Node? node)
The isEqualNode(node) method must return true if node is not null and context object equals node, and false otherwise.
DOMString?lookupNamespaceURI(DOMString? prefix)
DOMString?lookupPrefix(DOMString? namespace)
voidnormalize()
Node
removeChild(Node child)
The removeChild(child) method must return the result of pre-removing child from the context object.
Node
replaceChild(Node node, Node child)
The replaceChild(node, child) method must return the result of replacing child with node within the context object.
Referenced by
ChildNodereplace(...)
DocumentimportNode(...)
MutationObserverobserve(...)
MutationRecordtarget
NodeFilteracceptNode(...)
NodeIteratorroot
NodeListitem(...)
ParentNodeprepend(...)
RangesurroundContents(...)
TreeWalkerroot